<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@page import="java.util.Map;"  %>
<%
	String tip = (String) request.getAttribute("tip");
	String tipImage = (String) request.getAttribute("tipImage");
	String tipEmail = (String) request.getAttribute("tipEmail");
	String tipUsername = (String) request.getAttribute("tipUsername");
	String email = (String) request.getAttribute("email");
	String username = (String) request.getAttribute("username");
	String password = (String) request.getAttribute("password");
	String rePassword = (String) request.getAttribute("rePassword");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>PaaS平台IDE--用户注册</title>
<script type="text/javascript" src="/daycodefront/res/js/register.js"></script>
<script type="text/javascript" src="/daycodefront/res/js/validate_client.js"></script>
<link href="/daycodefront/res/css/default_layout.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
.tip_validate{ font-size:12px; color:red;}
label{font-family :Courier, "Courier New", monospace ;}
.title{ font-size: 25px; margin:20px auto 10px; width:450px;}
.inputPanel{ height:350px; margin:0px auto;}
.inputPanel ul{ list-style:none; }
.inputPanel ul li label{display:inline-block; text-align:right; width:100px; margin-left:200px;}
.inputPanel ul li input{width:300px; height: 25px; line-height: 25px;}
.inputPanel .tiphead{width: 250px; height:30px; margin-left: 110px; font-size: 14px; color: red;}
.inputPanel ul li .tip {width: 350px; height:25px; margin-left: 310px; font-size: 12px; color: red; text-align:left; }
.inputPanel ul li .validate input{width:80px; height: 30px; line-height: 30px; }
.inputPanel ul li .validate img:hover {cursor: pointer; }
.but_register {padding-left: 110px; margin-left:200px;margin-top:10px;}
.but_register img:hover {cursor: pointer; }
</style>
<script type="text/javascript" >
</script>
</head>
<body>
	<div id="header">
		<%@include file="jpaas_jsp/header.jsp" %>
	</div>
	<div id="content_body">
		<div id="content">
			<div class="title"><label>注册账号</label></div>
			<div class="inputPanel">
				<form name="registerForm" action="register" method="post">
					<input type="hidden" name="regFlag" value="isReg"/>
					<div>
						<div class="tiphead"><span ><%=tip == null ? "" : tip%></span></div> 
						<ul>
							<li>
								<label align="right">注册邮箱：</label> 
								<input id="email" type="text" name="email" onfocus="hideError('email');" onblur="validateForm('email');"/>
								<span id="tip_email" class="tip_validate"></span>
								<div class="tip"><s:fielderror fieldName="email" id="tip_server_email"/><%=tipEmail == null ? "" : tipEmail%></div> 
							</li>
							<li>
								<label align="right">用户名：</label> 
								<input id="username" type="text" name="username" onfocus="hideError('username');" onblur="validateForm('username');"/>
								<span id="tip_username" class="tip_validate"></span> 
								<div class="tip"><s:fielderror fieldName="username" id="tip_server_username"/><%=tipUsername == null ? "" : tipUsername%></div>
							</li>
							<li>
								<label align="right">设置密码：</label> 
								<input id="password" type="password" name="password" onfocus="hideError('password');" onblur="validateForm('password');"/> 
								<span id="tip_password" class="tip_validate"></span>
								<div class="tip"><s:fielderror fieldName="password" id="tip_server_password"/></div>
							</li>
							<li>
								<label align="right">确认密码：</label>
								<input id="rePassword" type="password" name="rePassword" onfocus="hideError('rePassword');" onblur="validateForm('rePassword');"/>
								<span id="tip_rePassword" class="tip_validate"></span> 
								<div class="tip"><s:fielderror fieldName="rePassword" id="tip_server_rePassword"/></div>
							</li>
							<li>
								<span class="validate"><label align="right">验证码：</label>
								<input id="validate" type="text" name="validate" onfocus="hideError('validate');" onblur="validateForm('validate');"/>
								&nbsp;&nbsp;&nbsp;<img id="image" src="/daycodefront/jpaas_jsp/image.jsp" title="看不清楚，换一张" onclick="reloadImage();"></span>
								<span id="tip_validate" class="tip_validate"></span>
								<div class="tip"><s:fielderror fieldName="tipImage" id="tip_server_validate"/></div>
							</li>
						</ul>
					</div>
					<div class="but_register">
							<img src="/daycodefront/image/but_register.png" 
							onmouseover="this.src='/daycodefront/image/but_register1.png'" 
							onmouseout="this.src='/daycodefront/image/but_register.png'"
							alt="立即注册" onclick="register()"/>
					</div>
				</form>
			</div>
		</div>
	</div>
	<div id="footer">
		<%@include file="jpaas_jsp/footer.jsp" %>
	</div>
</body>
<script type="text/javascript" >

	function init(){
		var email = document.getElementById("email");
		var username = document.getElementById("username");
		var password = document.getElementById("password");
		var rePassword = document.getElementById("rePassword");
		email.value = "<%=email!=null? email:""%>";
		username.value = "<%=username!=null? username:""%>";
		password.value ="<%=password!=null? password:""%>" ;
		rePassword.value = "<%=rePassword!=null? rePassword:""%>" ;
	}
	init();
</script>
</html>
